package com.swf.common.partner;

import com.alibaba.fastjson.JSON;

public class FastJsonUtils {
	public static void main(String[] args) {
		A a = new A();
		a.setA("123");
		a.setB("456");
		a.setC(111);
		String s = JSON.toJSONString(a);
		System.out.println(s);
		Object b = JSON.toJavaObject(JSON.parseObject(s), A.class);
		if (b instanceof A){
			A c = (A)b;
			System.out.println(c.getC());
		}else{
			System.out.println("error");
		}
	}
	
	
	
	
}

class A{
	private String a;
	private String b;
	private int c;
	public String getA() {
		return a;
	}
	public void setA(String a) {
		this.a = a;
	}
	public String getB() {
		return b;
	}
	public void setB(String b) {
		this.b = b;
	}
	public int getC() {
		return c;
	}
	public void setC(int c) {
		this.c = c;
	}
	
	
}